package com.lcxw.hxzbadmin.service.configservice;

import com.lcxw.hxzbadmin.dao.configmapper.ActivityMapper;
import com.lcxw.hxzbadmin.entity.pojo.Activity;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;

@Component
public class ActivityService {

    @Resource
    ActivityMapper activityMapper;

    /**
     * 1、插入一条活动记录
     */
    public int insert(Activity activity){
        return activityMapper.insert(activity);
    }

    /**
     * 2、通过id删除一条活动
     */
    public int deleteById(int id){
        return activityMapper.deleteById(id);
    }

    /**
     * 3、通过id查询一条活动记录
     */
    public Activity selectById(int id){
        return activityMapper.selectById(id);
    }

    /**
     * 4、查询所有活动记录
     */
    public List<Activity> selectAll(){
        return activityMapper.selectAll();
    }

    /**
     * 5、更新一条活动记录
     */
    public int updateById(Activity activity){
        return activityMapper.updateById(activity);
    }

    /**
     * 6、动态查询个数
     */
    public int selectCountDync(String name,String startTime,String endTime,String status){
        return activityMapper.selectCountDync(name, startTime, endTime, status);
    }

    /**
     * 7、动态查询
     */
    public List<Activity> selectDync(String name,String startTime,String endTime,String status,int pageIndex,int pageSize){
        return activityMapper.selectDync(name, startTime, endTime, status, pageIndex, pageSize);
    }
}
